export default {
	namespaced: true,
	state: {
		menus: []
	},
	mutations: {
		updateMenus: (state, menus) => {
			state.menus = menus;
		},
		registerMenus: (state, menus) => {
			state.menus = [...state.menus, ...menus];
		}
	},
	actions: {
		async register(menus) {
			if (!menus) {
				return;
			}
			if (!(menus instanceof Array)) {
				menus = [menus];
			}
			context.commit("registerMenus", menus);
		}
	}
}
